NSImageUtils =
{
	SIZEMODE_MIN_RATIO : 0
	,
	SIZEMODE_MAX_RATIO : 1
	,
	SIZEMODE_NO_RATIO : 2
	,
	setSize : function( image, width, height, sizeMode )
	{
		if( sizeMode == NSImageUtils.SIZEMODE_NO_RATIO )
		{
			image.width = width;
			image.height = height;
			return;
		}
		var _sx=width/image.width;
		var _sy=height/image.height;
		var _scale;
		switch( sizeMode )
		{
			case NSImageUtils.SIZEMODE_MIN_RATIO:
				_scale = Math.min( _sx, _sy );
				break;
			case NSImageUtils.SIZEMODE_MAX_RATIO:
				_scale = Math.max( _sx, _sy );
				break;
		}
		
		var _preHeight = image.height;
		image.width = image.width*_scale;
		// 자동 셋팅 될 경우가 있음
		if( _preHeight == image.height )
			image.height = image.height*_scale;
	}
}